
clear matrix
clear
cd "C:\Users\Owner\Documents\1_Research\Research in Progress\Courts\Pol_y_Gob\
set mem 40M
use "Politica_y_Gobierno.dta", clear

xtset jcode year


logit jexit  ///  
        /* Terms */ cfixedt dfixedt ctlimit dtlimit             /// 
        /* Constitutional change */  secular cchange1 cchange2   /// 
        /* Fixed number, size */  jn cjnfixed                   ///
        /* Incentives: Appointment */ capres calegis cacounc    ///                          
        /* Incentives: Judicial Review */ creview               ///
        /* Time in office */ t t2 t3                          ///  
        if jct==0                                            ///
        , cluster(jcode)
estimates store reg01

logit jexit  ///  
        /* Terms */ cfixedt dfixedt ctlimit dtlimit             /// 
        /* Constitutional change */  secular cchange1 cchange2  /// 
        /* Fixed number, size */  jn cjnfixed                   ///
        /* Incentives: Appointment */ capres calegis cacounc    ///                          
        /* Incentives: Judicial Review */ creview               ///
        /* Tribunal */ jct                                      ///
        /* Time in office */ t t2 t3                           /// 
        , cluster(jcode)
estimates store reg02
predict prexit

xml_tab reg01 reg02, save("1_table.xls") below ///
        stats(N) sheet("Table") stars(* 0.1 ** 0.05) format((S2100) (N2202)) replace  ///
        keep(creview jct jn cjnfixed cfixedt dfixedt ctlimit dtlimit capres calegis cacounc secular cchange1 cchange2 t t2 t3 _cons)

lincom creview+jct

lincom ctlimit+dtlimit*6   
lincom ctlimit+dtlimit*7
lincom ctlimit+dtlimit*8
lincom ctlimit+dtlimit*9
lincom ctlimit+dtlimit*10
lincom ctlimit+dtlimit*11
lincom ctlimit+dtlimit*12
lincom ctlimit+dtlimit*14
lincom ctlimit+dtlimit*15 

lincom cfixedt+dfixedt*4
lincom cfixedt+dfixedt*6
lincom cfixedt+dfixedt*7
lincom cfixedt+dfixedt*8
lincom cfixedt+dfixedt*9

* Corte: vitalicio, sin reforma
sum jexit prexit if (jct==0 & cfixedt==0 & dfixed==0 & ctlimit==0 & dtlimit==0 & cchange1==0) 
* Corte: vitalicio, con reforma
sum jexit prexit if (jct==0 & cfixedt==0 & dfixed==0 & ctlimit==0 & dtlimit==0 & cchange1==1) 
* Corte: 4 anios con reeleccion, sin reforma
sum jexit prexit if (jct==0 & cfixedt==1 & dfixed==4 & ctlimit==0 & dtlimit==0 & cchange1==0) 
* Corte: 10 anios sin reeleccion, sin reforma
sum jexit prexit if (jct==0 & cfixedt==0 & dfixed==0 & ctlimit==1 & dtlimit==10 & cchange1==0) 






